Skip to content

Move model classes to a version-independent package - #622

Open
dweindl wants to merge 2 commits into
PEtab-dev:mainfrom
dweindl:shared-models
Open

dweindl wants to merge 2 commits into
PEtab-dev:mainfrom
dweindl:shared-models

Conversation

@dweindl

@dweindl dweindl commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The model classes serve both PEtab v1 and v2 but lived in petab.v1.models, with petab.v2.models re-exporting them. That suggested PySB and BNGL models were supported with PEtab v1.

This moves the implementation to the private package petab._models; petab.v1.models and petab.v2.models re-export it, so all existing import paths keep working. petab.v1.models.pysb_model and petab.v1.models.bngl_model are deprecated in the changelog only, without a runtime warning for now. PySB and BNGL tests and fixtures move to tests/models.

For review: the first commit only moves files. In the moved model and test files, the second commit only changes imports and paths.

🤖 Generated with Claude Code

@codecov-commenter

codecov-commenter commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.14478% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.18%. Comparing base (d21ee3b) to head (1365b1a).

Files with missing lines Patch % Lines
petab/_models/pysb_model.py 79.88% 31 Missing and 4 partials ⚠️
petab/_models/sbml_model.py 82.26% 15 Missing and 10 partials ⚠️
petab/_models/bngl_model.py 85.80% 18 Missing and 5 partials ⚠️
petab/_models/model.py 70.76% 15 Missing and 4 partials ⚠️
petab/v1/models/bngl_model.py 0.00% 5 Missing ⚠️
petab/v1/models/pysb_model.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #622   +/-   ##
=======================================
  Coverage   80.18%   80.18%           
=======================================
  Files          70       75    +5     
  Lines        8442     8483   +41     
  Branches     1544     1544           
=======================================
+ Hits         6769     6802   +33     
- Misses       1182     1190    +8     
  Partials      491      491           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

dweindl and others added 2 commits November 23, 2026 14:33
Move the model implementation from `petab/v1/models` to
`petab/_models`, and the PySB and BNGL tests and fixtures from
`tests/v1` to `tests/models`, without changes; the imports are fixed in
the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The model classes serve both PEtab v1 and v2, but lived in
`petab.v1.models`, with `petab.v2.models` re-exporting them. This
suggested that PySB and BNGL models were supported with PEtab v1.

Move the implementation to the private package `petab._models` (in the
previous commit; here, only imports change). `petab.v1.models` and
`petab.v2.models` re-export it. Deprecate (for now only in the changelog)
the PySB and BNGL modules in `petab.v1.models`.

Move the PySB and BNGL tests and fixtures to `tests/models`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dweindl
dweindl marked this pull request as ready for review November 23, 2026 13:39
@dweindl
dweindl requested a review from a team as a code owner November 23, 2026 13:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants